package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.brand.BrandListVo;
import com.cskaoyan.bean.market.Brand;
import com.cskaoyan.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/brand")
class WxBrandController {

    @Autowired
    BrandService brandService;



    //显示所有品牌商的信息
    @PostMapping("list")
    //page=1&limit=10
    public BaseRespVo cartList(BaseParam baseParam) {
        BrandListVo brandListVo = brandService.cartlist(baseParam);
        return BaseRespVo.ok(brandListVo);
    }

    //显示单个品牌商的信息
    @GetMapping("detail")
    //wx/brand/detail?id=1046027
    public BaseRespVo cartDetail(Integer id){
        Brand brand = brandService.cartDetail(id);
        return BaseRespVo.ok(brand);
    }
}
